21. Exercise: Create a Share Intent

Creating a Share Intent

Now it's your turn! Complete the TODOs in T04b.03-Exercise-ShareText.

SOLUTION:
  • Create a void method called shareText that accepts a string as a parameter.
  • Set the media type and title of the chooser.
  • Create an intent using ShareCompat.IntentBuilder.
  • Replace the Toast message.